@extends('dashboard.base')

@section('content')
<div class="container-fluid">
	<div class="row">
		<div class="col">
			<div class="card">
          <div class="card-header"><strong>编辑用户</div>
            <div class="card-body">
              <form class="form-horizontal" action="{{ empty($user)? route('admin.users.store'):route('admin.users.update', $user) }}" method="post">
                @text([
                'name' => 'name', 
                'label' => '用户名', 
                'default' => $user->name??''
                ]) 
                @endtext
                @text(['name' => 'email', 'label' => '邮箱', 'default' => $user->email??'']) @endtext
                @text(['name' => 'password', 'label' => '密码']) @endtext
                @csrf
                
                @isset($user)
			        @method('PUT')
                @endisset

                <div class="form-group row">
                  <label class="col-md-2 col-form-label" for="text-input"></label>
                  <div class="col-md-9">
                    <button type="submit" class="btn btn-sm btn-primary">提交</button>
                  </div>
                </div>
              </form>
            </div>
            @errmsg
            @enderrmsg
      </div>
		</div>
	</div>
</div>	
@endsection

@section('javascript')
<script>
</script>
@endsection